<!DOCTYPE html>
<html lang="en">
  <head>
    <title>BigUInt Structure Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset="utf-8">
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
    <script src="../js/lunr.min.js" defer></script>
    <script src="../js/typeahead.jquery.js" defer></script>
    <script src="../js/jazzy.search.js" defer></script>
  </head>
  <body>

    <a name="//apple_ref/swift/Struct/BigUInt" class="dashAnchor"></a>

    <a title="BigUInt Structure Reference"></a>

    <header class="header">
      <p class="header-col header-col--primary">
        <a class="header-link" href="../index.html">
          BigInt  Docs
        </a>
         (85% documented)
      </p>
    
      <p class="header-col--secondary">
        <form role="search" action="../search.json">
          <input type="text" placeholder="Search documentation" data-typeahead>
        </form>
      </p>
    
        <p class="header-col header-col--secondary">
          <a class="header-link" href="https://github.com/attaswift/BigInt">
            <img class="header-icon" src="../img/gh.png"/>
            View on GitHub
          </a>
        </p>
    
        <p class="header-col header-col--secondary">
          <a class="header-link" href="dash-feed://https%3A%2F%2Fattaswift.github.io%2FBigInt%2Freference%2Fdocsets%2FBigInt.xml">
            <img class="header-icon" src="../img/dash.png"/>
            Install in Dash
          </a>
        </p>
    </header>

    <p class="breadcrumbs">
      <a class="breadcrumb" href="../index.html">BigInt Reference</a>
      <img class="carat" src="../img/carat.png" />
      BigUInt Structure Reference
    </p>

    <div class="content-wrapper">
      <nav class="navigation">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/BinaryFloatingPoint.html">BinaryFloatingPoint</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Extensions/String.html">String</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="../Structs.html">Structures</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/BigInt.html">BigInt</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/BigInt/Sign.html">– Sign</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/BigInt/Words.html">– Words</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/BigUInt.html">BigUInt</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="../Structs/BigUInt/Words.html">– Words</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">

        <section class="section">
          <div class="section-content top-matter">
            <h1>BigUInt</h1>
              <div class="declaration">
                <div class="language">
                  
                  <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">BigUInt</span> <span class="p">:</span> <span class="kt">UnsignedInteger</span></code></pre>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">BigUInt</span><span class="p">:</span> <span class="kt">Codable</span></code></pre>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">BigUInt</span><span class="p">:</span> <span class="kt">Comparable</span></code></pre>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">BigUInt</span><span class="p">:</span> <span class="kt">Hashable</span></code></pre>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">BigUInt</span><span class="p">:</span> <span class="kt">ExpressibleByIntegerLiteral</span></code></pre>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">BigUInt</span><span class="p">:</span> <span class="kt">Strideable</span></code></pre>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">BigUInt</span><span class="p">:</span> <span class="kt">ExpressibleByStringLiteral</span></code></pre>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">BigUInt</span><span class="p">:</span> <span class="kt">CustomStringConvertible</span></code></pre>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">BigUInt</span><span class="p">:</span> <span class="kt">CustomPlaygroundDisplayConvertible</span></code></pre>

                </div>
              </div>
            <p>An arbitary precision unsigned integer type, also known as a &ldquo;big integer&rdquo;.</p>

<p>Operations on big integers never overflow, but they may take a long time to execute.
The amount of memory (and address space) available is the only constraint to the magnitude of these numbers.</p>

<p>This particular big integer type uses base-2^64 digits to represent integers; you can think of it as a wrapper
around <code>Array&lt;UInt64&gt;</code>. (In fact, <code>BigUInt</code> only uses an array if there are more than two digits.)</p>

              <div class="slightly-smaller">
                <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/BigUInt.swift#L16-L61">Show on GitHub</a>
              </div>
          </div>
        </section>

        <section class="section">
          <div class="section-content">
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV4Worda"></a>
                    <a name="//apple_ref/swift/Alias/Word" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV4Worda">Word</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The type representing a digit in <code>BigUInt</code>&lsquo;s underlying number system.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Word</span> <span class="o">=</span> <span class="kt">UInt</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/BigUInt.swift#L18">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntVACycfc"></a>
                    <a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntVACycfc">init()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Initializes a new BigUInt with value 0.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/BigUInt.swift#L34-L37">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV5wordsACSaySuG_tcfc"></a>
                    <a name="//apple_ref/swift/Method/init(words:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV5wordsACSaySuG_tcfc">init(words:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Initializes a new BigUInt with the specified digits. The digits are ordered from least to most significant.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">words</span><span class="p">:</span> <span class="p">[</span><span class="kt"><a href="../Structs/BigUInt.html#/s:6BigInt0A4UIntV4Worda">Word</a></span><span class="p">])</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/BigUInt.swift#L50-L54">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Addition"></a>
                <a name="//apple_ref/swift/Section/Addition" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Addition"></a>
                  <h3 class="section-name"><p>Addition</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV1poiyA2C_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method/+(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV1poiyA2C_ACtFZ">+(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Add <code>a</code> and <code>b</code> together and return the result.</p>
<div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(max(a.count, b.count))

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">+</span> <span class="p">(</span><span class="nv">a</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">b</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Addition.swift#L84-L86">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV2peoiyyACz_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method/+=(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV2peoiyyACz_ACtFZ">+=(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Add <code>a</code> and <code>b</code> together, and store the sum in <code>a</code>.</p>
<div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(max(a.count, b.count))

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">+=</span> <span class="p">(</span><span class="nv">a</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">b</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Addition.swift#L91-L93">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:Sz8isSignedSbvpZ"></a>
                    <a name="//apple_ref/swift/Variable/isSigned" class="dashAnchor"></a>
                    <a class="token" href="#/s:Sz8isSignedSbvpZ">isSigned</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">var</span> <span class="nv">isSigned</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/BigUInt.swift#L64-L66">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV6isZeroSbvp"></a>
                    <a name="//apple_ref/swift/Property/isZero" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV6isZeroSbvp">isZero</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Return true iff this integer is zero.</p>
<div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(1)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isZero</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/BigUInt.swift#L71-L78">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV6signumACyF"></a>
                    <a name="//apple_ref/swift/Method/signum()" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV6signumACyF">signum()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns <code>1</code> if this value is, positive; otherwise, <code>0</code>.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">signum</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The sign of this number, expressed as an integer of the same type.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/BigUInt.swift#L83-L85">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Bitwise%20Operations"></a>
                <a name="//apple_ref/swift/Section/Bitwise Operations" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Bitwise%20Operations"></a>
                  <h3 class="section-name"><p>Bitwise Operations</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV1topyA2CFZ"></a>
                    <a name="//apple_ref/swift/Method/~(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV1topyA2CFZ">~(_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Return the ones&rsquo; complement of <code>a</code>.</p>
<div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(a.count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">prefix</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">~</span> <span class="p">(</span><span class="nv">a</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Bitwise Ops.swift#L15-L17">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV2oeoiyyACz_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method/|=(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV2oeoiyyACz_ACtFZ">|=(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Calculate the bitwise OR of <code>a</code> and <code>b</code>, and store the result in <code>a</code>.</p>
<div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(max(a.count, b.count))

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">|=</span> <span class="p">(</span><span class="nv">a</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">b</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Bitwise Ops.swift#L22-L27">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV2aeoiyyACz_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method/&amp;=(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV2aeoiyyACz_ACtFZ">&=(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Calculate the bitwise AND of <code>a</code> and <code>b</code> and return the result.</p>
<div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(max(a.count, b.count))

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">&amp;=</span> <span class="p">(</span><span class="nv">a</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">b</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Bitwise Ops.swift#L32-L36">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV2xeoiyyACz_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method/^=(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV2xeoiyyACz_ACtFZ">^=(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Calculate the bitwise XOR of <code>a</code> and <code>b</code> and return the result.</p>
<div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(max(a.count, b.count))

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">^=</span> <span class="p">(</span><span class="nv">a</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">b</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Bitwise Ops.swift#L41-L46">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:Se4fromxs7Decoder_p_tKcfc"></a>
                    <a name="//apple_ref/swift/Method/init(from:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:Se4fromxs7Decoder_p_tKcfc">init(from:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">from</span> <span class="nv">decoder</span><span class="p">:</span> <span class="kt">Decoder</span><span class="p">)</span> <span class="k">throws</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Codable.swift#L143-L150">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:SE6encode2toys7Encoder_p_tKF"></a>
                    <a name="//apple_ref/swift/Method/encode(to:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:SE6encode2toys7Encoder_p_tKF">encode(to:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">encode</span><span class="p">(</span><span class="n">to</span> <span class="nv">encoder</span><span class="p">:</span> <span class="kt">Encoder</span><span class="p">)</span> <span class="k">throws</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Codable.swift#L152-L154">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Comparison"></a>
                <a name="//apple_ref/swift/Section/Comparison" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Comparison"></a>
                  <h3 class="section-name"><p>Comparison</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV7compareySo18NSComparisonResultVAC_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method/compare(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV7compareySo18NSComparisonResultVAC_ACtFZ">compare(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Compare <code>a</code> to <code>b</code> and return an <code>NSComparisonResult</code> indicating their order.</p>
<div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">compare</span><span class="p">(</span><span class="n">_</span> <span class="nv">a</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="n">_</span> <span class="nv">b</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">ComparisonResult</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Comparable.swift#L17-L25">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV2eeoiySbAC_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method/==(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV2eeoiySbAC_ACtFZ">==(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Return true iff <code>a</code> is equal to <code>b</code>.</p>
<div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">==</span> <span class="p">(</span><span class="nv">a</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">b</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Comparable.swift#L30-L32">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV1loiySbAC_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method/&lt;(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV1loiySbAC_ACtFZ"><(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Return true iff <code>a</code> is less than <code>b</code>.</p>
<div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">&lt;</span> <span class="p">(</span><span class="nv">a</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">b</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Comparable.swift#L37-L39">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/NSData%20Conversion"></a>
                <a name="//apple_ref/swift/Section/NSData Conversion" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/NSData%20Conversion"></a>
                  <h3 class="section-name"><p>NSData Conversion</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntVyACSWcfc"></a>
                    <a name="//apple_ref/swift/Method/init(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntVyACSWcfc">init(_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Initialize a BigInt from bytes accessed from an UnsafeRawBufferPointer</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">_</span> <span class="nv">buffer</span><span class="p">:</span> <span class="kt">UnsafeRawBufferPointer</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Data Conversion.swift#L15-L44">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntVyAC10Foundation4DataVcfc"></a>
                    <a name="//apple_ref/swift/Method/init(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntVyAC10Foundation4DataVcfc">init(_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Initializes an integer from the bits stored inside a piece of <code>Data</code>.
The data is assumed to be in network (big-endian) byte order.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">_</span> <span class="nv">data</span><span class="p">:</span> <span class="kt">Data</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Data Conversion.swift#L49-L81">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV9serialize10Foundation4DataVyF"></a>
                    <a name="//apple_ref/swift/Method/serialize()" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV9serialize10Foundation4DataVyF">serialize()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Return a <code>Data</code> value that contains the base-256 representation of this integer, in network (big-endian) byte order.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">serialize</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Data</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Data Conversion.swift#L84-L109">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Division"></a>
                <a name="//apple_ref/swift/Section/Division" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Division"></a>
                  <h3 class="section-name"><p>Division</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV20quotientAndRemainder10dividingByAC0D0_AC9remaindertAC_tF"></a>
                    <a name="//apple_ref/swift/Method/quotientAndRemainder(dividingBy:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV20quotientAndRemainder10dividingByAC0D0_AC9remaindertAC_tF">quotientAndRemainder(dividingBy:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Divide this integer by <code>y</code> and return the resulting quotient and remainder.</p>
<div class="aside aside-requires">
    <p class="aside-title">Requires</p>
    <code>y &gt; 0</code>

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count^2)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">quotientAndRemainder</span><span class="p">(</span><span class="n">dividingBy</span> <span class="nv">y</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="nv">quotient</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">remainder</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p><code>(quotient, remainder)</code> where <code>quotient = floor(self/y)</code>, <code>remainder = self - quotient * y</code></p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Division.swift#L295-L300">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV1doiyA2C_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method//(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV1doiyA2C_ACtFZ">/(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Divide <code>x</code> by <code>y</code> and return the quotient.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    Use <code>divided(by:)</code> if you also need the remainder.

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">/</span> <span class="p">(</span><span class="nv">x</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">y</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Division.swift#L305-L307">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV1roiyA2C_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method/%(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV1roiyA2C_ACtFZ">%(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Divide <code>x</code> by <code>y</code> and return the remainder.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    Use <code>divided(by:)</code> if you also need the remainder.

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">%</span> <span class="p">(</span><span class="nv">x</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">y</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Division.swift#L312-L317">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV2deoiyyACz_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method//=(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV2deoiyyACz_ACtFZ">/=(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Divide <code>x</code> by <code>y</code> and store the quotient in <code>x</code>.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    Use <code>divided(by:)</code> if you also need the remainder.

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">/=</span> <span class="p">(</span><span class="nv">x</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">y</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Division.swift#L322-L325">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV2reoiyyACz_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method/%=(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV2reoiyyACz_ACtFZ">%=(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Divide <code>x</code> by <code>y</code> and store the remainder in <code>x</code>.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    Use <code>divided(by:)</code> if you also need the remainder.

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">%=</span> <span class="p">(</span><span class="nv">x</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">y</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Division.swift#L330-L333">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Exponentiation"></a>
                <a name="//apple_ref/swift/Section/Exponentiation" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Exponentiation"></a>
                  <h3 class="section-name"><p>Exponentiation</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV5poweryACSiF"></a>
                    <a name="//apple_ref/swift/Method/power(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV5poweryACSiF">power(_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns this integer raised to the power <code>exponent</code>.</p>

<p>This function calculates the result by <a href="https://en.wikipedia.org/wiki/Exponentiation_by_squaring">successively squaring the base while halving the exponent</a>.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    This function can be unreasonably expensive for large exponents, which is why <code>exponent</code> is
    a simple integer value. If you want to calculate big exponents, you&rsquo;ll probably need to use
    the modulo arithmetic variant.

</div><div class="aside aside-see-also">
    <p class="aside-title">See also</p>
    <code>BigUInt.power(_:, modulus:)</code>

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O((exponent * self.count)^log2(3)) or somesuch. The result may require a large amount of memory, too.

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">power</span><span class="p">(</span><span class="n">_</span> <span class="nv">exponent</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>1 if <code>exponent == 0</code>, otherwise <code>self</code> raised to <code>exponent</code>. (This implies that <code>0.power(0) == 1</code>.)</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Exponentiation.swift#L24-L43">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV5power_7modulusA2C_ACtF"></a>
                    <a name="//apple_ref/swift/Method/power(_:modulus:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV5power_7modulusA2C_ACtF">power(_:<wbr>modulus:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns the remainder of this integer raised to the power <code>exponent</code> in modulo arithmetic under <code>modulus</code>.</p>

<p>Uses the <a href="https://en.wikipedia.org/wiki/Modular_exponentiation#Right-to-left_binary_method">right-to-left binary method</a>.</p>
<div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(exponent.count * modulus.count^log2(3)) or somesuch

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">power</span><span class="p">(</span><span class="n">_</span> <span class="nv">exponent</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">modulus</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Exponentiation.swift#L52-L72">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:Sz7exactlyxSgqd___tcSBRd__lufc"></a>
                    <a name="//apple_ref/swift/Method/init(exactly:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:Sz7exactlyxSgqd___tcSBRd__lufc">init(exactly:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">init</span><span class="p">?</span><span class="o">&lt;</span><span class="kt">T</span><span class="o">&gt;</span><span class="p">(</span><span class="n">exactly</span> <span class="nv">source</span><span class="p">:</span> <span class="kt">T</span><span class="p">)</span> <span class="k">where</span> <span class="kt">T</span> <span class="p">:</span> <span class="kt">BinaryFloatingPoint</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Floating Point Conversion.swift#L10-L20">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:Szyxqd__cSBRd__lufc"></a>
                    <a name="//apple_ref/swift/Method/init(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:Szyxqd__cSBRd__lufc">init(_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">init</span><span class="o">&lt;</span><span class="kt">T</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_</span> <span class="nv">source</span><span class="p">:</span> <span class="kt">T</span><span class="p">)</span> <span class="k">where</span> <span class="kt">T</span> <span class="p">:</span> <span class="kt">BinaryFloatingPoint</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Floating Point Conversion.swift#L22-L24">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Greatest%20Common%20Divisor"></a>
                <a name="//apple_ref/swift/Section/Greatest Common Divisor" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Greatest%20Common%20Divisor"></a>
                  <h3 class="section-name"><p>Greatest Common Divisor</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV21greatestCommonDivisor4withA2C_tF"></a>
                    <a name="//apple_ref/swift/Method/greatestCommonDivisor(with:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV21greatestCommonDivisor4withA2C_tF">greatestCommonDivisor(with:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns the greatest common divisor of <code>self</code> and <code>b</code>.</p>
<div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count^2) where count = max(self.count, b.count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">greatestCommonDivisor</span><span class="p">(</span><span class="n">with</span> <span class="nv">b</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/GCD.swift#L15-L33">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV7inverseyACSgACF"></a>
                    <a name="//apple_ref/swift/Method/inverse(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV7inverseyACSgACF">inverse(_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns the <a href="https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm#Modular_integers">multiplicative inverse of this integer in modulo <code>modulus</code> arithmetic</a>,
or <code>nil</code> if there is no such number.</p>
<div class="aside aside-requires">
    <p class="aside-title">Requires</p>
    modulus &gt; 1

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count^3)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">inverse</span><span class="p">(</span><span class="n">_</span> <span class="nv">modulus</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span><span class="p">?</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>If <code>gcd(self, modulus) == 1</code>, the value returned is an integer <code>a &lt; modulus</code> such that <code>(a * self) % modulus == 1</code>. If <code>self</code> and <code>modulus</code> aren&rsquo;t coprime, the return value is <code>nil</code>.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/GCD.swift#L43-L57">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Hashing"></a>
                <a name="//apple_ref/swift/Section/Hashing" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Hashing"></a>
                  <h3 class="section-name"><p>Hashing</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV4hash4intoys6HasherVz_tF"></a>
                    <a name="//apple_ref/swift/Method/hash(into:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV4hash4intoys6HasherVz_tF">hash(into:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Append this <code>BigUInt</code> to the specified hasher.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">hash</span><span class="p">(</span><span class="n">into</span> <span class="nv">hasher</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">Hasher</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Hashable.swift#L13-L17">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:Sj7exactlyxSgqd___tcSzRd__lufc"></a>
                    <a name="//apple_ref/swift/Method/init(exactly:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:Sj7exactlyxSgqd___tcSzRd__lufc">init(exactly:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">init</span><span class="p">?</span><span class="o">&lt;</span><span class="kt">T</span><span class="o">&gt;</span><span class="p">(</span><span class="n">exactly</span> <span class="nv">source</span><span class="p">:</span> <span class="kt">T</span><span class="p">)</span> <span class="k">where</span> <span class="kt">T</span> <span class="p">:</span> <span class="kt">BinaryInteger</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Integer Conversion.swift#L10-L20">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:Szyxqd__cSzRd__lufc"></a>
                    <a name="//apple_ref/swift/Method/init(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:Szyxqd__cSzRd__lufc">init(_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">init</span><span class="o">&lt;</span><span class="kt">T</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_</span> <span class="nv">source</span><span class="p">:</span> <span class="kt">T</span><span class="p">)</span> <span class="k">where</span> <span class="kt">T</span> <span class="p">:</span> <span class="kt">BinaryInteger</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Integer Conversion.swift#L22-L25">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:Sz18truncatingIfNeededxqd___tcSzRd__lufc"></a>
                    <a name="//apple_ref/swift/Method/init(truncatingIfNeeded:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:Sz18truncatingIfNeededxqd___tcSzRd__lufc">init(truncatingIfNeeded:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">init</span><span class="o">&lt;</span><span class="kt">T</span><span class="o">&gt;</span><span class="p">(</span><span class="n">truncatingIfNeeded</span> <span class="nv">source</span><span class="p">:</span> <span class="kt">T</span><span class="p">)</span> <span class="k">where</span> <span class="kt">T</span> <span class="p">:</span> <span class="kt">BinaryInteger</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Integer Conversion.swift#L27-L29">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:Sz8clampingxqd___tcSzRd__lufc"></a>
                    <a name="//apple_ref/swift/Method/init(clamping:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:Sz8clampingxqd___tcSzRd__lufc">init(clamping:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">init</span><span class="o">&lt;</span><span class="kt">T</span><span class="o">&gt;</span><span class="p">(</span><span class="n">clamping</span> <span class="nv">source</span><span class="p">:</span> <span class="kt">T</span><span class="p">)</span> <span class="k">where</span> <span class="kt">T</span> <span class="p">:</span> <span class="kt">BinaryInteger</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Integer Conversion.swift#L31-L38">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV14integerLiteralACs6UInt64V_tcfc"></a>
                    <a name="//apple_ref/swift/Method/init(integerLiteral:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV14integerLiteralACs6UInt64V_tcfc">init(integerLiteral:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Initialize a new big integer from an integer literal.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">integerLiteral</span> <span class="nv">value</span><span class="p">:</span> <span class="kt">UInt64</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Integer Conversion.swift#L78-L80">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Multiplication"></a>
                <a name="//apple_ref/swift/Section/Multiplication" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Multiplication"></a>
                  <h3 class="section-name"><p>Multiplication</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV8multiply6byWordySu_tF"></a>
                    <a name="//apple_ref/swift/Method/multiply(byWord:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV8multiply6byWordySu_tF">multiply(byWord:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Multiply this big integer by a single word, and store the result in place of the original big integer.</p>
<div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">multiply</span><span class="p">(</span><span class="n">byWord</span> <span class="nv">y</span><span class="p">:</span> <span class="kt"><a href="../Structs/BigUInt.html#/s:6BigInt0A4UIntV4Worda">Word</a></span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Multiplication.swift#L16-L28">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV10multiplied6byWordACSu_tF"></a>
                    <a name="//apple_ref/swift/Method/multiplied(byWord:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV10multiplied6byWordACSu_tF">multiplied(byWord:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Multiply this big integer by a single Word, and return the result.</p>
<div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">multiplied</span><span class="p">(</span><span class="n">byWord</span> <span class="nv">y</span><span class="p">:</span> <span class="kt"><a href="../Structs/BigUInt.html#/s:6BigInt0A4UIntV4Worda">Word</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Multiplication.swift#L33-L37">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV14multiplyAndAdd__9shiftedByyAC_SuSitF"></a>
                    <a name="//apple_ref/swift/Method/multiplyAndAdd(_:_:shiftedBy:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV14multiplyAndAdd__9shiftedByyAC_SuSitF">multiplyAndAdd(_:<wbr>_:<wbr>shiftedBy:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Multiply <code>x</code> by <code>y</code>, and add the result to this integer, optionally shifted <code>shift</code> words to the left.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    This is the fused multiply/shift/add operation; it is more efficient than doing the components
individually. (The fused operation doesn&rsquo;t need to allocate space for temporary big integers.)

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">multiplyAndAdd</span><span class="p">(</span><span class="n">_</span> <span class="nv">x</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="n">_</span> <span class="nv">y</span><span class="p">:</span> <span class="kt"><a href="../Structs/BigUInt.html#/s:6BigInt0A4UIntV4Worda">Word</a></span><span class="p">,</span> <span class="n">shiftedBy</span> <span class="nv">shift</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p><code>self</code> is set to <code>self + (x * y) &lt;&lt; (shift * 2^Word.bitWidth)</code></p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Multiplication.swift#L45-L71">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV10multiplied2byA2C_tF"></a>
                    <a name="//apple_ref/swift/Method/multiplied(by:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV10multiplied2byA2C_tF">multiplied(by:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Multiply this integer by <code>y</code> and return the result.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    This uses the naive O(n^2) multiplication algorithm unless both arguments have more than
<code><a href="../Structs/BigUInt.html#/s:6BigInt0A4UIntV25directMultiplicationLimitSivpZ">BigUInt.directMultiplicationLimit</a></code> words.

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(n^log2(3))

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">multiplied</span><span class="p">(</span><span class="n">by</span> <span class="nv">y</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Multiplication.swift#L78-L81">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV25directMultiplicationLimitSivpZ"></a>
                    <a name="//apple_ref/swift/Variable/directMultiplicationLimit" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV25directMultiplicationLimitSivpZ">directMultiplicationLimit</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Multiplication switches to an asymptotically better recursive algorithm when arguments have more words than this limit.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="k">var</span> <span class="nv">directMultiplicationLimit</span><span class="p">:</span> <span class="kt">Int</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Multiplication.swift#L84">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV1moiyA2C_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method/*(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV1moiyA2C_ACtFZ">*(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Multiply <code>a</code> by <code>b</code> and return the result.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    This uses the naive O(n^2) multiplication algorithm unless both arguments have more than
<code><a href="../Structs/BigUInt.html#/s:6BigInt0A4UIntV25directMultiplicationLimitSivpZ">BigUInt.directMultiplicationLimit</a></code> words.

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(n^log2(3))

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">*</span> <span class="p">(</span><span class="nv">x</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">y</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Multiplication.swift#L91-L149">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV2meoiyyACz_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method/*=(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV2meoiyyACz_ACtFZ">*=(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Multiply <code>a</code> by <code>b</code> and store the result in <code>a</code>.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">*=</span> <span class="p">(</span><span class="nv">a</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">b</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Multiplication.swift#L152-L154">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Primality%20Testing"></a>
                <a name="//apple_ref/swift/Section/Primality Testing" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Primality%20Testing"></a>
                  <h3 class="section-name"><p>Primality Testing</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV21isStrongProbablePrimeySbACF"></a>
                    <a name="//apple_ref/swift/Method/isStrongProbablePrime(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV21isStrongProbablePrimeySbACF">isStrongProbablePrime(_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns true iff this integer passes the <a href="https://en.wikipedia.org/wiki/Probable_prime">strong probable prime test</a> for the specified base.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">isStrongProbablePrime</span><span class="p">(</span><span class="n">_</span> <span class="nv">base</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Prime Test.swift#L40-L64">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV7isPrime6roundsSbSi_tF"></a>
                    <a name="//apple_ref/swift/Method/isPrime(rounds:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV7isPrime6roundsSbSi_tF">isPrime(rounds:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns true if this integer is probably prime. Returns false if this integer is definitely not prime.</p>

<p>This function performs a probabilistic <a href="https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test">Miller-Rabin Primality Test</a>, consisting of <code>rounds</code> iterations, 
each calculating the strong probable prime test for a random base. The number of rounds is 10 by default,
but you may specify your own choice.</p>

<p>To speed things up, the function checks if <code>self</code> is divisible by the first few prime numbers before
diving into (slower) Miller-Rabin testing.</p>

<p>Also, when <code>self</code> is less than 82 bits wide, <code>isPrime</code> does a deterministic test that is guaranteed to 
return a correct result.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">isPrime</span><span class="p">(</span><span class="nv">rounds</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">10</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Prime Test.swift#L79-L121">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV13randomInteger16withMaximumWidth5usingACSi_xztSGRzlFZ"></a>
                    <a name="//apple_ref/swift/Method/randomInteger(withMaximumWidth:using:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV13randomInteger16withMaximumWidth5usingACSi_xztSGRzlFZ">randomInteger(withMaximumWidth:<wbr>using:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Create a big unsigned integer consisting of <code>width</code> uniformly distributed random bits.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="n">randomInteger</span><span class="o">&lt;</span><span class="kt">RNG</span><span class="o">&gt;</span><span class="p">(</span><span class="n">withMaximumWidth</span> <span class="nv">width</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="n">using</span> <span class="nv">generator</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">RNG</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span> <span class="k">where</span> <span class="kt">RNG</span> <span class="p">:</span> <span class="kt">RandomNumberGenerator</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>width</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The maximum number of one bits in the result.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>generator</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The source of randomness.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>A big unsigned integer less than <code>1 &lt;&lt; width</code>.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Random.swift#L15-L33">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV13randomInteger16withMaximumWidthACSi_tFZ"></a>
                    <a name="//apple_ref/swift/Method/randomInteger(withMaximumWidth:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV13randomInteger16withMaximumWidthACSi_tFZ">randomInteger(withMaximumWidth:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Create a big unsigned integer consisting of <code>width</code> uniformly distributed random bits.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    <p>I use a <code>SystemRandomGeneratorGenerator</code> as the source of randomness.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">randomInteger</span><span class="p">(</span><span class="n">withMaximumWidth</span> <span class="nv">width</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>width</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The maximum number of one bits in the result.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>A big unsigned integer less than <code>1 &lt;&lt; width</code>.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Random.swift#L41-L44">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV13randomInteger14withExactWidth5usingACSi_xztSGRzlFZ"></a>
                    <a name="//apple_ref/swift/Method/randomInteger(withExactWidth:using:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV13randomInteger14withExactWidth5usingACSi_xztSGRzlFZ">randomInteger(withExactWidth:<wbr>using:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Create a big unsigned integer consisting of <code>width-1</code> uniformly distributed random bits followed by a one bit.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    <p>If <code>width</code> is zero, the result is zero.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="n">randomInteger</span><span class="o">&lt;</span><span class="kt">RNG</span><span class="o">&gt;</span><span class="p">(</span><span class="n">withExactWidth</span> <span class="nv">width</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="n">using</span> <span class="nv">generator</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">RNG</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span> <span class="k">where</span> <span class="kt">RNG</span> <span class="p">:</span> <span class="kt">RandomNumberGenerator</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>width</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The number of bits required to represent the answer.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>generator</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The source of randomness.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>A random big unsigned integer whose width is <code>width</code>.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Random.swift#L53-L60">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV13randomInteger14withExactWidthACSi_tFZ"></a>
                    <a name="//apple_ref/swift/Method/randomInteger(withExactWidth:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV13randomInteger14withExactWidthACSi_tFZ">randomInteger(withExactWidth:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Create a big unsigned integer consisting of <code>width-1</code> uniformly distributed random bits followed by a one bit.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    If <code>width</code> is zero, the result is zero.

</div><div class="aside aside-note">
    <p class="aside-title">Note</p>
    <p>I use a <code>SystemRandomGeneratorGenerator</code> as the source of randomness.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">randomInteger</span><span class="p">(</span><span class="n">withExactWidth</span> <span class="nv">width</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>A random big unsigned integer whose width is <code>width</code>.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Random.swift#L68-L71">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV13randomInteger8lessThan5usingA2C_xztSGRzlFZ"></a>
                    <a name="//apple_ref/swift/Method/randomInteger(lessThan:using:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV13randomInteger8lessThan5usingA2C_xztSGRzlFZ">randomInteger(lessThan:<wbr>using:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Create a uniformly distributed random unsigned integer that&rsquo;s less than the specified limit.</p>
<div class="aside aside-precondition">
    <p class="aside-title">Precondition</p>
    <p><code>limit &gt; 0</code>.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="n">randomInteger</span><span class="o">&lt;</span><span class="kt">RNG</span><span class="o">&gt;</span><span class="p">(</span><span class="n">lessThan</span> <span class="nv">limit</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="n">using</span> <span class="nv">generator</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">RNG</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span> <span class="k">where</span> <span class="kt">RNG</span> <span class="p">:</span> <span class="kt">RandomNumberGenerator</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>limit</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The upper bound on the result.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>generator</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The source of randomness.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>A random big unsigned integer that is less than <code>limit</code>.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Random.swift#L80-L88">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV13randomInteger8lessThanA2C_tFZ"></a>
                    <a name="//apple_ref/swift/Method/randomInteger(lessThan:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV13randomInteger8lessThanA2C_tFZ">randomInteger(lessThan:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Create a uniformly distributed random unsigned integer that&rsquo;s less than the specified limit.</p>
<div class="aside aside-precondition">
    <p class="aside-title">Precondition</p>
    <code>limit &gt; 0</code>.

</div><div class="aside aside-note">
    <p class="aside-title">Note</p>
    <p>I use a <code>SystemRandomGeneratorGenerator</code> as the source of randomness.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="nf">randomInteger</span><span class="p">(</span><span class="n">lessThan</span> <span class="nv">limit</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>limit</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The upper bound on the result.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>A random big unsigned integer that is less than <code>limit</code>.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Random.swift#L97-L100">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Shift%20Operators"></a>
                <a name="//apple_ref/swift/Section/Shift Operators" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Shift%20Operators"></a>
                  <h3 class="section-name"><p>Shift Operators</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV3ggeoiyyACz_xtSzRzlFZ"></a>
                    <a name="//apple_ref/swift/Method/&gt;&gt;=(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV3ggeoiyyACz_xtSzRzlFZ">>>=(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Undocumented</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">&gt;&gt;=</span> <span class="o">&lt;</span><span class="kt">Other</span><span class="o">&gt;</span><span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="kt">Other</span><span class="p">)</span> <span class="k">where</span> <span class="kt">Other</span> <span class="p">:</span> <span class="kt">BinaryInteger</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Shifts.swift#L109-L119">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV3lleoiyyACz_xtSzRzlFZ"></a>
                    <a name="//apple_ref/swift/Method/&lt;&lt;=(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV3lleoiyyACz_xtSzRzlFZ"><<=(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Undocumented</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">&lt;&lt;=</span> <span class="o">&lt;</span><span class="kt">Other</span><span class="o">&gt;</span><span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="kt">Other</span><span class="p">)</span> <span class="k">where</span> <span class="kt">Other</span> <span class="p">:</span> <span class="kt">BinaryInteger</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Shifts.swift#L121-L127">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV2ggoiyA2C_xtSzRzlFZ"></a>
                    <a name="//apple_ref/swift/Method/&gt;&gt;(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV2ggoiyA2C_xtSzRzlFZ">>>(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Undocumented</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">&gt;&gt;</span> <span class="o">&lt;</span><span class="kt">Other</span><span class="o">&gt;</span><span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="kt">Other</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span> <span class="k">where</span> <span class="kt">Other</span> <span class="p">:</span> <span class="kt">BinaryInteger</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Shifts.swift#L129-L137">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV2lloiyA2C_xtSzRzlFZ"></a>
                    <a name="//apple_ref/swift/Method/&lt;&lt;(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV2lloiyA2C_xtSzRzlFZ"><<(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Undocumented</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">&lt;&lt;</span> <span class="o">&lt;</span><span class="kt">Other</span><span class="o">&gt;</span><span class="p">(</span><span class="nv">lhs</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">rhs</span><span class="p">:</span> <span class="kt">Other</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span> <span class="k">where</span> <span class="kt">Other</span> <span class="p">:</span> <span class="kt">BinaryInteger</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Shifts.swift#L139-L144">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Square%20Root"></a>
                <a name="//apple_ref/swift/Section/Square Root" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Square%20Root"></a>
                  <h3 class="section-name"><p>Square Root</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV10squareRootACyF"></a>
                    <a name="//apple_ref/swift/Method/squareRoot()" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV10squareRootACyF">squareRoot()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns the integer square root of a big integer; i.e., the largest integer whose square isn&rsquo;t greater than <code>value</code>.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">squareRoot</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>floor(sqrt(self))</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Square Root.swift#L15-L29">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV6Stridea"></a>
                    <a name="//apple_ref/swift/Alias/Stride" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV6Stridea">Stride</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>A type that can represent the distance between two values ofa <code>BigUInt</code>.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">Stride</span> <span class="o">=</span> <span class="kt"><a href="../Structs/BigInt.html">BigInt</a></span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Strideable.swift#L11">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV8advanced2byAc2AV_tF"></a>
                    <a name="//apple_ref/swift/Method/advanced(by:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV8advanced2byAc2AV_tF">advanced(by:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Adds <code>n</code> to <code>self</code> and returns the result. Traps if the result would be less than zero.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">advanced</span><span class="p">(</span><span class="n">by</span> <span class="nv">n</span><span class="p">:</span> <span class="kt"><a href="../Structs/BigInt.html">BigInt</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Strideable.swift#L14-L16">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV8distance2toA2AVAC_tF"></a>
                    <a name="//apple_ref/swift/Method/distance(to:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV8distance2toA2AVAC_tF">distance(to:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns the (potentially negative) difference between <code>self</code> and <code>other</code> as a <code><a href="../Structs/BigInt.html">BigInt</a></code>. Never traps.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">distance</span><span class="p">(</span><span class="n">to</span> <span class="nv">other</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt"><a href="../Structs/BigInt.html">BigInt</a></span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Strideable.swift#L19-L21">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/String%20Conversion"></a>
                <a name="//apple_ref/swift/Section/String Conversion" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/String%20Conversion"></a>
                  <h3 class="section-name"><p>String Conversion</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV_5radixACSgx_SitcSyRzlufc"></a>
                    <a name="//apple_ref/swift/Method/init(_:radix:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV_5radixACSgx_SitcSyRzlufc">init(_:<wbr>radix:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Initialize a big integer from an ASCII representation in a given radix. Numerals above <code>9</code> are represented by
letters from the English alphabet.</p>
<div class="aside aside-requires">
    <p class="aside-title">Requires</p>
    <code>radix &gt; 1 &amp;&amp; radix &lt; 36</code>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">init</span><span class="p">?</span><span class="o">&lt;</span><span class="kt">S</span><span class="o">&gt;</span><span class="p">(</span><span class="n">_</span> <span class="nv">text</span><span class="p">:</span> <span class="kt">S</span><span class="p">,</span> <span class="nv">radix</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">10</span><span class="p">)</span> <span class="k">where</span> <span class="kt">S</span> <span class="p">:</span> <span class="kt">StringProtocol</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>The integer represented by <code>text</code>, or nil if <code>text</code> contains a character that does not represent a numeral in <code>radix</code>.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/String Conversion.swift#L39-L72">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV20unicodeScalarLiteralACs7UnicodeO0E0V_tcfc"></a>
                    <a name="//apple_ref/swift/Method/init(unicodeScalarLiteral:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV20unicodeScalarLiteralACs7UnicodeO0E0V_tcfc">init(unicodeScalarLiteral:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Initialize a new big integer from a Unicode scalar.
The scalar must represent a decimal digit.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">unicodeScalarLiteral</span> <span class="nv">value</span><span class="p">:</span> <span class="kt">UnicodeScalar</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/String Conversion.swift#L169-L171">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV30extendedGraphemeClusterLiteralACSS_tcfc"></a>
                    <a name="//apple_ref/swift/Method/init(extendedGraphemeClusterLiteral:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV30extendedGraphemeClusterLiteralACSS_tcfc">init(extendedGraphemeClusterLiteral:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Initialize a new big integer from an extended grapheme cluster.
The cluster must consist of a decimal digit.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">extendedGraphemeClusterLiteral</span> <span class="nv">value</span><span class="p">:</span> <span class="kt">String</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/String Conversion.swift#L175-L177">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV13stringLiteralACSS_tcfc"></a>
                    <a name="//apple_ref/swift/Method/init(stringLiteral:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV13stringLiteralACSS_tcfc">init(stringLiteral:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Initialize a new big integer from a decimal number represented by a string literal of arbitrary length.
The string must contain only decimal digits.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="n">stringLiteral</span> <span class="nv">value</span><span class="p">:</span> <span class="kt">StringLiteralType</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/String Conversion.swift#L181-L183">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV11descriptionSSvp"></a>
                    <a name="//apple_ref/swift/Property/description" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV11descriptionSSvp">description</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Return the decimal representation of this integer.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">description</span><span class="p">:</span> <span class="kt">String</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/String Conversion.swift#L208-L210">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV21playgroundDescriptionypvp"></a>
                    <a name="//apple_ref/swift/Property/playgroundDescription" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV21playgroundDescriptionypvp">playgroundDescription</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Return the playground quick look representation of this integer.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">playgroundDescription</span><span class="p">:</span> <span class="kt">Any</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/String Conversion.swift#L223-L226">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Subtraction"></a>
                <a name="//apple_ref/swift/Section/Subtraction" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Subtraction"></a>
                  <h3 class="section-name"><p>Subtraction</p>
</h3>
                </div>
              </div>
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV25subtractReportingOverflow_9shiftedBySbAC_SitF"></a>
                    <a name="//apple_ref/swift/Method/subtractReportingOverflow(_:shiftedBy:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV25subtractReportingOverflow_9shiftedBySbAC_SitF">subtractReportingOverflow(_:<wbr>shiftedBy:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Subtract <code>other</code> from this integer in place, and return a flag indicating if the operation caused an
arithmetic overflow. <code>other</code> is shifted <code>shift</code> digits to the left before being subtracted.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    If the result indicates an overflow, then <code>self</code> becomes the twos&rsquo; complement of the absolute difference.

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">subtractReportingOverflow</span><span class="p">(</span><span class="n">_</span> <span class="nv">b</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="n">shiftedBy</span> <span class="nv">shift</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Subtraction.swift#L68-L89">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV28subtractingReportingOverflow_9shiftedByAC12partialValue_Sb8overflowtAC_SitF"></a>
                    <a name="//apple_ref/swift/Method/subtractingReportingOverflow(_:shiftedBy:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV28subtractingReportingOverflow_9shiftedByAC12partialValue_Sb8overflowtAC_SitF">subtractingReportingOverflow(_:<wbr>shiftedBy:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Subtract <code>other</code> from this integer, returning the difference and a flag indicating arithmetic overflow.
<code>other</code> is shifted <code>shift</code> digits to the left before being subtracted.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    If <code>overflow</code> is true, then the result value is the twos&rsquo; complement of the absolute value of the difference.

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">subtractingReportingOverflow</span><span class="p">(</span><span class="n">_</span> <span class="nv">other</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="n">shiftedBy</span> <span class="nv">shift</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="nv">partialValue</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">overflow</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Subtraction.swift#L96-L100">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV28subtractingReportingOverflowyAC12partialValue_Sb8overflowtACF"></a>
                    <a name="//apple_ref/swift/Method/subtractingReportingOverflow(_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV28subtractingReportingOverflowyAC12partialValue_Sb8overflowtACF">subtractingReportingOverflow(_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Subtracts <code>other</code> from <code>self</code>, returning the result and a flag indicating arithmetic overflow.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    When the operation overflows, then <code>partialValue</code> is the twos&rsquo; complement of the absolute value of the difference.

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">subtractingReportingOverflow</span><span class="p">(</span><span class="n">_</span> <span class="nv">other</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="p">(</span><span class="nv">partialValue</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">overflow</span><span class="p">:</span> <span class="kt">Bool</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Subtraction.swift#L106-L108">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV8subtract_9shiftedByyAC_SitF"></a>
                    <a name="//apple_ref/swift/Method/subtract(_:shiftedBy:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV8subtract_9shiftedByyAC_SitF">subtract(_:<wbr>shiftedBy:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Subtract <code>other</code> from this integer in place.
<code>other</code> is shifted <code>shift</code> digits to the left before being subtracted.</p>
<div class="aside aside-requires">
    <p class="aside-title">Requires</p>
    self &gt;= other * 2^shift

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">subtract</span><span class="p">(</span><span class="n">_</span> <span class="nv">other</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="n">shiftedBy</span> <span class="nv">shift</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Subtraction.swift#L115-L118">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV11subtracting_9shiftedByA2C_SitF"></a>
                    <a name="//apple_ref/swift/Method/subtracting(_:shiftedBy:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV11subtracting_9shiftedByA2C_SitF">subtracting(_:<wbr>shiftedBy:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Subtract <code>b</code> from this integer, and return the difference.
<code>b</code> is shifted <code>shift</code> digits to the left before being subtracted.</p>
<div class="aside aside-requires">
    <p class="aside-title">Requires</p>
    self &gt;= b * 2^shift

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">subtracting</span><span class="p">(</span><span class="n">_</span> <span class="nv">other</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="n">shiftedBy</span> <span class="nv">shift</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Subtraction.swift#L125-L129">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV9decrement9shiftedByySi_tF"></a>
                    <a name="//apple_ref/swift/Method/decrement(shiftedBy:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV9decrement9shiftedByySi_tF">decrement(shiftedBy:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Decrement this integer by one.</p>
<div class="aside aside-requires">
    <p class="aside-title">Requires</p>
    !isZero

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">mutating</span> <span class="kd">func</span> <span class="nf">decrement</span><span class="p">(</span><span class="n">shiftedBy</span> <span class="nv">shift</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">0</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Subtraction.swift#L135-L137">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV1soiyA2C_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method/-(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV1soiyA2C_ACtFZ">-(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Subtract <code>b</code> from <code>a</code> and return the result.</p>
<div class="aside aside-requires">
    <p class="aside-title">Requires</p>
    a &gt;= b

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(a.count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">-</span> <span class="p">(</span><span class="nv">a</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">b</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">BigUInt</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Subtraction.swift#L143-L145">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV2seoiyyACz_ACtFZ"></a>
                    <a name="//apple_ref/swift/Method/-=(_:_:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV2seoiyyACz_ACtFZ">-=(_:<wbr>_:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Subtract <code>b</code> from <code>a</code> and store the result in <code>a</code>.</p>
<div class="aside aside-requires">
    <p class="aside-title">Requires</p>
    a &gt;= b

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(a.count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">static</span> <span class="kd">func</span> <span class="o">-=</span> <span class="p">(</span><span class="nv">a</span><span class="p">:</span> <span class="k">inout</span> <span class="kt">BigUInt</span><span class="p">,</span> <span class="nv">b</span><span class="p">:</span> <span class="kt">BigUInt</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Subtraction.swift#L151-L153">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV5bitAtSbSi_tcip"></a>
                    <a name="//apple_ref/swift/Method/subscript(bitAt:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV5bitAtSbSi_tcip">subscript(bitAt:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Undocumented</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">subscript</span><span class="p">(</span><span class="n">bitAt</span> <span class="nv">index</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Words and Bits.swift#L24-L40">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV8bitWidthSivp"></a>
                    <a name="//apple_ref/swift/Property/bitWidth" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV8bitWidthSivp">bitWidth</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The minimum number of bits required to represent this integer in binary.</p>
<div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(1)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">bitWidth</span><span class="p">:</span> <span class="kt">Int</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>floor(log2(2 * self + 1))</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Words and Bits.swift#L48-L51">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV19leadingZeroBitCountSivp"></a>
                    <a name="//apple_ref/swift/Property/leadingZeroBitCount" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV19leadingZeroBitCountSivp">leadingZeroBitCount</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The number of leading zero bits in the binary representation of this integer in base <code>2^(Word.bitWidth)</code>.
This is useful when you need to normalize a <code>BigUInt</code> such that the top bit of its most significant word is 1.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    0 is considered to have zero leading zero bits.

</div><div class="aside aside-see-also">
    <p class="aside-title">See also</p>
    width

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(1)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">leadingZeroBitCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>A value in <code>0...(Word.bitWidth - 1)</code>.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Words and Bits.swift#L60-L63">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV20trailingZeroBitCountSivp"></a>
                    <a name="//apple_ref/swift/Property/trailingZeroBitCount" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV20trailingZeroBitCountSivp">trailingZeroBitCount</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The number of trailing zero bits in the binary representation of this integer.</p>
<div class="aside aside-note">
    <p class="aside-title">Note</p>
    0 is considered to have zero trailing zero bits.

</div><div class="aside aside-complexity">
    <p class="aside-title">Complexity</p>
    O(count)

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">trailingZeroBitCount</span><span class="p">:</span> <span class="kt">Int</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>A value in <code>0...width</code>.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Words and Bits.swift#L70-L74">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:Sz5WordsQa"></a>
                    <a name="//apple_ref/swift/Struct/Words" class="dashAnchor"></a>
                    <a class="token" href="#/s:Sz5WordsQa">Words</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                        <a href="../Structs/BigUInt/Words.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Words</span> <span class="p">:</span> <span class="kt">RandomAccessCollection</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Words and Bits.swift#L90-L101">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:Sz5words5WordsQzvp"></a>
                    <a name="//apple_ref/swift/Property/words" class="dashAnchor"></a>
                    <a class="token" href="#/s:Sz5words5WordsQzvp">words</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">words</span><span class="p">:</span> <span class="kt"><a href="../Structs/BigUInt/Words.html">Words</a></span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Words and Bits.swift#L">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:6BigInt0A4UIntV5wordsACx_tcSTRzSu7ElementRtzlufc"></a>
                    <a name="//apple_ref/swift/Method/init(words:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:6BigInt0A4UIntV5wordsACx_tcSTRzSu7ElementRtzlufc">init(words:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Undocumented</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">init</span><span class="o">&lt;</span><span class="kt"><a href="../Structs/BigUInt/Words.html">Words</a></span><span class="o">&gt;</span><span class="p">(</span><span class="nv">words</span><span class="p">:</span> <span class="kt"><a href="../Structs/BigUInt/Words.html">Words</a></span><span class="p">)</span> <span class="k">where</span> <span class="kt"><a href="../Structs/BigUInt/Words.html">Words</a></span> <span class="p">:</span> <span class="kt">Sequence</span><span class="p">,</span> <span class="kt"><a href="../Structs/BigUInt/Words.html">Words</a></span><span class="o">.</span><span class="kt">Element</span> <span class="o">==</span> <span class="kt">BigUInt</span><span class="o">.</span><span class="kt"><a href="../Structs/BigUInt.html#/s:6BigInt0A4UIntV4Worda">Word</a></span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/attaswift//tree/refs/tags/v5.3.0/Sources/Words and Bits.swift#L105-L135">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </section>

      </article>
    </div>
    <section class="footer">
      <p>© 2021 <a class="link" href="https://twitter.com/lorentey" target="_blank" rel="noopener" rel="external">Károly Lőrentey</a>. (Last updated: 2021-09-06)</p>
      <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="noopener" rel="external">jazzy ♪♫ v0.14.0</a>, a <a class="link" href="https://realm.io" target="_blank" rel="noopener" rel="external">Realm</a> project.</p>
    </section>
  </body>
</div>
</html>
